﻿@{
    ViewBag.Title = "UpdateTestLib";
    Layout = "~/Views/Shared/_GridCommonLayout.cshtml";
}
<!--test9.9.19.13-->
<div id="Content">
<div id="UpdateTestLb">
     <!--编辑试题-->
                      <div  >
                                        <!--test-->
                                        <form class="smart-form"  id="submitform" >
                                            <div>
                                                

                                                <div class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">所属题型:&nbsp </strong></label>
                                                    <label data-bind="text:IProblemType"></label>
                                                    <label class="toggle state-error " style="float: right; font-size: 15px; margin-top: -1px">
                                                        <input type="checkbox"  name="checkbox-toggle" value="1" data-bind="checked:IStuOpen">
                                                        <i data-swchoff-text="OFF" data-swchon-text="ON"></i>是否对学生公开</label>



                                                </div>

                                                <!--test-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">标题</strong><label class="txt-color-red">(*必填100字以内)</label>:</label>
                                                   <label class="textarea textarea-expandable">
                                                        <textarea id="TitleId" name="TitleId" class="custom-scroll" rows="3" placeholder='添加标题' data-bind="text:STitle">
                                                                </textarea>
                                                      
                                                    </label>
                                                  

                                                </div>
                                                <!--内容编辑  todo-->
                                                <div  id="ContentId" class="row " style="margin-left: 3%; margin-right: 3%; margin-top: 10px">

                                                    <label style="margin-top: 2px;"><strong style="font-size: 15px">内容:</strong></label>
                                                    <button id="edit" class="btn btn-primary pull-right" type="button">
                                                        <i class="fa fa-angle-double-down"></i>
                                                    </button>
                                                    <div id="editorId" style="display: none; height: 180px;margin-top:15px;">
                                                    </div>


                                                </div>
                                                <!--/内容编辑-->




                                                <!--答案判断题test foreach: TFrecordSet-->
                                                <div id="QuesAnswerId"class="row " style="margin-left: 3%; margin-right: 3%; margin-top: 10px">
                                                    <label style="float:left"><strong style="font-size: 15px;">答案:</strong></label>
                                                    <table class="smart-form" style="float:left;margin-left:20px;">
                                                        <tr  id="trTFrecordSet">
                                                        </tr>
                                                    </table>
                                                </div>

                                                <!--/答案-->


                                               

                                                <!--添加选项-->
                                                <div id="OptionId"class="row " style="margin-left: 3%; margin-right: 3%; margin-top: 10px">
                                                    <div style="padding-bottom:5px;">
                                                    <label><strong style="font-size: 15px">选项:</strong></label>
                                                    &nbsp
                                                    <button id="AddbuttonId" class="btn btn-success btn-labeled pull-right " type="button" data-bind="click: $root.DataAddModel" style="padding:0 12px">
                                                        <span class="btn-label" ><i class="glyphicon glyphicon-plus"></i>
                                                        </span>增加选项</button>
                                                    <div style="clear:both;"></div>

                                                        </div>
                                                    <!--增加选项div-->
                                                    <div>
                                                        <!--to do-->
                                                        <table class="table table-striped table-bordered table-hover checkboxs">
                                                            <!--table head-->
                                                            <thead>
                                                                <tr>
                                                                    <th style="width: 1%;">
                                                                      
                                                                    </th>
                                                                    <!-- ko foreach: headers -->
                                                                    <th class="center " style="width: 35%">
                                                                        <a href="#" data-bind="text: displayText, click: $root.sort" style="color: black"></a>

                                                                    </th>
                                                                    <!-- /ko -->
                                                                    <th class="center" style="width: 12%">操作
                                                                    </th>
                                                                </tr>
                                                            </thead>
                                                            <!--/table head -->
                                                            <!--table body(Provider list)-->
                                                            <tbody data-bind="foreach: recordSet">
                                                                <tr class="selectable" onclick="">
                                                                    <td class="center">
                                                                     
                                                                        <input type="hidden" data-bind="value: Id, attr: { id: Id }" />
                                                                    </td>
                                                                    <td class='center'>
                                                                        <span data-bind='text: SOptionName,attr:{
                                                                        "data-pk":Id}' class="optionName" data-url='/api/TestLibExt/UpdateOptionName'
                                                                              data-type='text' data-name='optionName' data-title='选项:'></span>
                                                                    </td>
                                                                    <td class='center'>
                                                                        <span data-bind='html: $root.formatIsTrue(IIsTrue),attr:{
                                                                        "data-pk":Id}'class="optionAns"  data-url= '/api/TestLibExt/UpdateOptionAnswer' 
                                                                        data-type= 'select' data-name= 'optionAns' data-title= '答案:'
                                                                            data-source="[{value: 1, text: '正确'},{value: 0, text: '错误'}]" 
                                                                            ></span>
                                                                    </td>


                                                                    <td class="center">
                                                                        <button class="btn-success" data-bind="click: $root.DeleteModel" style="padding:0 12px">
                                                                            <i class="fa fa-times"></i>
                                                                        </button>



                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                            <!--/table body( Provider list)-->

                                                        </table>
                                                    </div>
                                                    <!--/增加选项div-->


                                                </div>
                                                <!--/添加选项-->


                                                <!-- 标记大纲位置-->
                                                <div class="row " style="margin-left: 3%; margin-right: 3%; margin-top: 10px">
                                                    <label class="label"><strong style="font-size: 15px">对应大纲位置：</strong></label>

                                                    <label class="select" style="float: left">
                                                        <select name="txtbSrSCharpter" id="txtbSrSCharpter" style="width: 200px;" data-bind="event: { change: $root.myChange }">

                                                            <option value="">---请选择章---</option>
                                                            @foreach (var itemSel in ViewBag.Charpter)
                                                            {
                                                                <option value="@itemSel.SCaptailName" data-value="@itemSel.Id" >
                                                                    @itemSel.SCaptailName</option> 
                                                            }
                                                        </select>
                                                    </label>

                                                    <label class="select" style="float: left;width: 200px;">
                                                         <select id="txtbSrITeaCatalog"></select>
                                                    </label>




                                                </div>
                                                <!-- /标记大纲位置-->

                                                <!--知识点-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%; margin-top: 10px" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">知识点:</strong></label>
                                                    <label class="textarea textarea-expandable">
                                                        <!--添加name属性，修正水印字不出现的问题-->
                                                        <textarea id="SPointersId" name="SPointersId" class="custom-scroll" rows="3" placeholder="请输入本题所涉及的知识考点" data-bind="text:SPointers"></textarea>
                                                    </label>
                                                </div>
                                                <!--/知识点-->

                                                <!--答案解析  add  by yzp 12.2 -->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%; margin-top: 10px" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">答案分析:</strong></label>
                                                    <label class="textarea textarea-expandable">
                                                        <!--添加name属性，修正水印字不出现的问题-->
                                                        <textarea id="AnswerAnalysis" name="AnswerAnalysis" class="custom-scroll" rows="3" placeholder="请输入本题的答案分析" data-bind="text:SAnalysis"></textarea>
                                                    </label>
                                                </div>
                                                <!--/答案解析-->

                                                     <!--难易度和区分度编辑TEST-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%; margin-top: 10px">
                                                      <table style="width:700px;">   
                                                           <tr>
                                                                <td style="width:120px"><label><strong>难易度</strong><label class="text-info">(10星最难)</label>:</label>

                                                                </td>
                                                               <td>
                                                                   <div id="Hard" class="rating" style="float: left; ">
                                                                       <input type="radio" id="stars-rating-10" name="stars-rating" value="10">
										<label for="stars-rating-10"><i class="fa fa-star"  ></i></label>
										<input type="radio" id="stars-rating-9" name="stars-rating" value="9">
										<label for="stars-rating-9"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-rating-8" name="stars-rating" value="8">
										<label for="stars-rating-8"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-rating-7" name="stars-rating"value="7">
										<label for="stars-rating-7"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-rating-6" name="stars-rating"value="6">
										<label for="stars-rating-6"><i class="fa fa-star"></i></label>
                                        <input type="radio" id="stars-rating-5" name="stars-rating" value="5">
										<label for="stars-rating-5"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-rating-4" name="stars-rating" value="4">
										<label for="stars-rating-4"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-rating-3" name="stars-rating" value="3">
										<label for="stars-rating-3"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-rating-2" name="stars-rating" value="2">
										<label for="stars-rating-2"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-rating-1" name="stars-rating"value="1">
										<label for="stars-rating-1"><i class="fa fa-star"></i></label>
                                                        </div>
                                                               </td>
                                                               <td style="width:120px"><label><strong>区分度</strong><label class="text-info">(10星最优)</label>：</label></td>
                                                                           <td>
                                                          <div id="Dif"class="rating"  style="float:left;" >
                                                              <input type="radio" id="stars-10" name="rating" value="10">
										<label for="stars-10"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-9" name="rating" value="9">
										<label for="stars-9"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-8" name="rating"value="8">
										<label for="stars-8"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-7" name="rating"value="7">
										<label for="stars-7"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-6" name="rating"value="6">
										<label for="stars-6"><i class="fa fa-star"></i></label>
                                         <input type="radio" id="stars-5" name="rating"value="5">
										<label for="stars-5"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-4" name="rating"value="4">
										<label for="stars-4"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-3" name="rating"value="3">
										<label for="stars-3"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-2" name="rating"value="2">
										<label for="stars-2"><i class="fa fa-star"></i></label>
										<input type="radio" id="stars-1" name="rating" value="1">
										<label for="stars-1"><i class="fa fa-star"></i></label>
                                                    </div>
                                                    </td>
                                               
                                                           </tr>

                                                      </table>
                                                  
                                        
                                                   
                                                  
                                                </div>
                                                <!--/难易度和区分度-->
                                            </div>
                                        </form>
                                        
                                         </div>                                    

                                       
                <!--end 编辑试题-->

      
    </div>
    <!--预览试题-->                               
    <div id="PreviewTestLib" style="display:none">
    

          <!--试题预览部分 test-->
                                   
     <form class="smart-form"  id="Previewform" >
                                            <div>
                                                <!--所属题型-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">所属题型:&nbsp </strong></label>
                                                    <label data-bind="text:IProblemType"></label>
                                                    
                                                    </div>
                                                <div>
                                                    <label class="toggle state-error " style="float: right; font-size: 15px; margin-top: -1px">是否对学生公开:
                                                        <label data-bind="text:IsOpenSet"></label></label>
                                                </div>
                                                <!--end 所属题型-->

                                                <!--标题-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">标 &nbsp&nbsp&nbsp&nbsp 题:&nbsp </strong></label>
                                                    <label data-bind='text:STitle' ></label>
                                                    </div>

                                                <!--end 标题-->
                                                <!--内容-->
                                                <div id="PrewContent"class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">内 &nbsp&nbsp&nbsp&nbsp 容:&nbsp </strong></label>
                                                    <label data-bind='html:SContent' ></label>
                                                    </div>
                                                <!--end 内容-->

                                                <!--选项  todo-->
                                                <div id="OptionList" class="row" style="margin-left: 3%; margin-right: 3%">
                                                    <label><strong style="font-size: 15px">选项:&nbsp </strong></label>
                                                    <div style="margin-left:3%">
                                                        <table class="table table-striped table-bordered table-hover checkboxs">
                                                        
                                                            <!--table body(Provider list)-->
                                                            <tbody data-bind="foreach: recordSet">
                                                                <tr class="selectable" onclick="" >
                                                                    
                                                                    <td ><span data-bind='text: SOptionName' ></span></td>
                                                                </tr>
                                                            </tbody>
                                                            <!--/table body( Provider list)-->

                                                        </table>
                                                    </div>
                                                </div>
                                                <!--end 选项-->

                                                <!--正确答案 针对选择题，用tabel呈现 取选项中IIstrue=1的选项的名称-->
                                                <div id="optLib" class="row" style="margin-left: 3%; margin-right: 3%">
                                                    <label><strong style="font-size: 15px">正确选项:&nbsp </strong></label>

                                                             <div style="margin-left:3%">
                                                        <table class="table table-striped table-bordered table-hover checkboxs">
                                                        
                                                            <!--table body(Provider list)-->
                                                            <tbody data-bind="foreach: AnswerRecordSet">
                                                                <tr class="selectable" onclick="">
                                                                    
                                                                    <td ><span data-bind='text: SOptionName' ></span></td>
                                                                </tr>
                                                            </tbody>
                                                            <!--/table body( Provider list)-->

                                                        </table>
                                                    </div>
                                                </div>
                                                <!--end 正确答案-->

                                                <!--正确答案 其他题型，直接用label呈现-->
                                                <div id="normalLib" class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">答案标示:&nbsp </strong></label>
                                                    <label data-bind="text:SAnswer"></label>
                                                </div>
                                                <!--end 正确答案-->

                                                <!--所属章节-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">所属章节:&nbsp </strong></label>
                                                    <label  data-bind='text:SCharpter'></label>
                                                </div>

                                                <!--end 所属章节-->

                                                <!--知识考点-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">知识考点:&nbsp </strong></label>
                                                    <label data-bind='text:SPointers'></label>
                                                </div>
                                                <!--end 知识考点--> 

                                               <!--答案解析  添加于12.2-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%" data-bind="with:NodeValue">
                                                    <label><strong style="font-size: 15px">答案解析:&nbsp </strong></label>
                                                    <label data-bind='text:SAnalysis'></label>
                                                </div>
                                                <!--end 答案解析-->



                                                    <!--难易度和区分度-->
                                                <div class="row" style="margin-left: 3%; margin-right: 3%; margin-top: 10px">
                                                      <table style="width:700px;">   
                                                           <tr>
                                                                <td style="width:120px"><label><strong>难易度</strong><label class="text-info">(10星最难)</label>:</label>

                                                                </td>
                                                               <td>
                                                                   <div id="Hardshow" class="rating " style="float: left; ">
                                                                       <input type="radio" id="rating-10" name="stars-show" value="10">
										<label for="stars-rating-10"><i class="fa fa-star"  ></i></label>
										<input type="radio" id="rating-9" name="stars-show" value="9">
										<label for="stars-rating-9"><i class="fa fa-star"></i></label>
										<input type="radio" id="rating-8" name="stars-show" value="8">
										<label for="stars-rating-8"><i class="fa fa-star"></i></label>
										<input type="radio" id="rating-7" name="stars-show"value="7">
										<label for="stars-rating-7"><i class="fa fa-star"></i></label>
										<input type="radio" id="rating-6" name="stars-show"value="6">
										<label for="stars-rating-6"><i class="fa fa-star"></i></label>
                                        <input type="radio" id="rating-5" name="stars-show" value="5">
										<label for="stars-rating-5"><i class="fa fa-star"></i></label>
										<input type="radio" id="rating-4" name="stars-show" value="4">
										<label for="stars-rating-4"><i class="fa fa-star"></i></label>
										<input type="radio" id="rating-3" name="stars-show" value="3">
										<label for="stars-rating-3"><i class="fa fa-star"></i></label>
										<input type="radio" id="rating-2" name="stars-show" value="2">
										<label for="stars-rating-2"><i class="fa fa-star"></i></label>
										<input type="radio" id="rating-1" name="stars-show"value="1">
										<label for="stars-rating-1"><i class="fa fa-star"></i></label>
                                                        </div>
                                                               </td>
                                                              
                                               
                                                               <td style="width:120px"><label><strong>区分度</strong><label class="text-info">(10星最优)</label>:</label>

                                                                </td>
                                                               <td>
                                                                   <div id="Diffdshow" class="rating" style="float: left; ">
                                                                       <input type="radio" id="Dif-10" name="show" value="10">
										<label for="stars-rating-10"><i class="fa fa-star"  ></i></label>
										<input type="radio" id="Dif-9" name="show" value="9">
										<label for="stars-rating-9"><i class="fa fa-star"></i></label>
										<input type="radio" id="Dif-8" name="show" value="8">
										<label for="stars-rating-8"><i class="fa fa-star"></i></label>
										<input type="radio" id="Dif-7" name="show"value="7">
										<label for="stars-rating-7"><i class="fa fa-star"></i></label>
										<input type="radio" id="Dif-6" name="show"value="6">
										<label for="stars-rating-6"><i class="fa fa-star"></i></label>
                                        <input type="radio" id="Dif-5" name="show" value="5">
										<label for="stars-rating-5"><i class="fa fa-star"></i></label>
										<input type="radio" id="Dif-4" name="show" value="4">
										<label for="stars-rating-4"><i class="fa fa-star"></i></label>
										<input type="radio" id="Dif-3" name="show" value="3">
										<label for="stars-rating-3"><i class="fa fa-star"></i></label>
										<input type="radio" id="Dif-2" name="show" value="2">
										<label for="stars-rating-2"><i class="fa fa-star"></i></label>
										<input type="radio" id="Dif-1" name="show"value="1">
										<label for="stars-rating-1"><i class="fa fa-star"></i></label>
                                                        </div>
                                                               </td>
                                                           </tr></table>
                                                  
                                        
                                                   
                                                  
                                                </div>
                                                <!--/难易度和区分度-->
                                                </div>
                                            </form>
 
 
    <!--end  预览试题--> 
        </div>
    </div>
<!--按钮组 页面的脚部-->
    <div id="TestLibFooter" class="row" style="margin-left: 3%; margin-right: 3%;margin-top:10px">
        <button id="CancelId" class="btn btn-success btn-large " type="button">取消</button>
        <button id="NextId" type="button" style="float:right;" class="btn btn-success btn-large " data-bind="click:$root.NexTStep">下一步</button>
        <button id="SubmitId" type="button" style="display:none;float:right" class="btn btn-success btn-large " >确定</button>
        <button id="PreId" type="button" style="display:none" data-bind="click:$root.PreStep" class="btn btn-success btn-large ">上一步</button>
    
    </div>
<input id="HiddenCourseID" type="hidden" value="@ViewBag.CourseID">
<!--end 按钮组 页面的脚部-->

@section script{
<script src="~/Js/bootstrap/bootstrap.js"></script>
<script src="~/Js/plugin/x-editable/x-editable.min.js"></script>
<script src="~/Scripts/ueditor/ueditor.config.js"></script>
<script src="~/Scripts/ueditor/ueditor.all.js"></script>
    <script src="~/Js/UpdateTestLib.js"></script>
    <script src="~/Scripts/jquery.validate.js"></script>

<script src="~/Scripts/jquery.validate-vsdoc.js"></script>
   
     }  